package com.transformer.shobal.java;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by tiny on 2015/1/25.
 */
public class MyInfo2  implements Parcelable{
    public int myId;
    public String myName;

    MyInfo2(Parcel source){
        myId = source.readInt();
        myName = source.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(myId);
        dest.writeString(myName);
    }




    public MyInfo2(int myId, String myName) {
        this.myId = myId;
        this.myName = myName;
    }

    @Override
    public String toString() {
        return "MyInfo2{" +
                "myId=" + myId +
                ", myName='" + myName + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MyInfo2 myInfo2 = (MyInfo2) o;

        if (myId != myInfo2.myId) return false;
        if (!myName.equals(myInfo2.myName)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = myId;
        result = 31 * result + myName.hashCode();
        return result;
    }

    public static final Parcelable.Creator<MyInfo2> CREATOR = new Creator<MyInfo2>() {
        @Override
        public MyInfo2 createFromParcel(Parcel source) {
            MyInfo2 myInfo2 = new MyInfo2(source);
            return myInfo2;
        }

        @Override
        public MyInfo2[] newArray(int size) {
            return new MyInfo2[size];
        }
    };

}
